package com.kldy8.kldyw.find.service;

import com.kldy8.kldyw.SystemSet;
import com.kldy8.kldyw.release.service.HttpCallback;
import com.kldy8.kldyw.release.service.HttpUtil;
import com.kldy8.kldyw.system.UrlBuilder;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Qun Chen on 2016/11/2 0002.
 * 发现模块api
 */
public class FindServiceApi {
    //TYPE_ACTOR
    public static final String TYPE_ACTOR = "actor";//附近的演员
    public static final String TYPE_RECRUIT = "recruit";//附近的招聘
    public static final String TYPE_STORE = "store";//附近的电影

    /****
     * @param page 默认为10条
     * @param lon  经度
     * @param lat  纬度
     * @param type TYPE_ACTOR, TYPE_RECRUIT, TYPE_STORE
     */
    public static void getDetectionList(int page, double lon, double lat, String type, HttpCallback callback) {
        String url = UrlBuilder.URL_BASE_API + UrlBuilder.URL_FIND_GET_DETECTION_LIST;
        Map<String, String> map = new HashMap<>();
        map.put("token", SystemSet.getInstance().getToken());
        map.put("page", page+"");
        map.put("lon",String.valueOf(lon));
        map.put("lat", String.valueOf(lat));
        map.put("type", type);
        HttpUtil.get(url, map, callback);
    }
}
